#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
void find(int* arr, int* a, int* b, int sz)
{
	int i = 0;
	int tmp = 0;
	for (i = 0; i < sz; i++)
	{
		tmp ^= arr[i];
	}
	int pos = 0;
	for (i = 0; i < 32; i++)
	{
		if ((tmp >> i) & 1==1)
		{
			pos = i;
			break;
		}
	}
	for (i = 0; i < sz; i++)
	{
		if ((arr[i] >> pos)&1 == 1)
		{
			(*a) ^= arr[i];
		}
		else
		{
			(*b) ^= arr[i];
		}
	}
}
int main()
{
	int arr[] = { 1,2,3,4,5,1,2,3,4,6};
	int a = 0;
	int b = 0;
	int sz = sizeof(arr) / sizeof(arr[0]);
	find(arr, &a, &b, sz);
	printf("%d %d", a, b);
	return 0;
}